Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add M117 support (print progress with octoprint) #1497

Closed
wants to merge 3 commits into from

Conversation

coaxial
Copy link

@coaxial coaxial commented Jul 5, 2021

This shows the print progress on the Mini's LCD when printing through Octoprint.

A few notes:

  • I didn't come up with the code, I only adapted this patch from the Llama Mini Firmware project and the credit goes to its author (Matthew Lloyd)
  • I also changed the logo when printing over serial: it's a smaller Octoprint logo (to make room for the print status text); it's basically the same image as on the Llama Mini Firmware, but with the Llama removed (since it doesn't match)
  • I can't test the changes because I don't want to void the warranty on my printer by breaking the appendix (which is why I'm backporting these changes to the official firmware)
  • I left the license notice as-is in src/gui/window_lcd_message.cpp since this file didn't exist in this codebase and comes straight from the Llama Mini Firmware project

Hopefully this can be merged and be part of the next release.

Closes #189.

edit: I can't see why it doesn't build, because to access holly.prusa3d.com I have to give access to all my repos (public and private)... I'd rather not.

@coaxial coaxial changed the base branch from RELEASE-4.3.2 to master July 5, 2021 18:22
@coaxial coaxial changed the base branch from master to RELEASE-4.3.2 July 5, 2021 18:32
Copy link
Collaborator

@DRracer DRracer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the PR is incomplete - window_lcd_message.hpp is missing, please update your PR. Thank you

@matthewlloyd
Copy link

A few notes on the legal side:

  • The commits have had the original author information removed. I do assert copyright on my code here and if you want to use my code, to avoid potential copyright issues, I insist that the commits need to follow Git's convention of including both author name (Matthew Lloyd) and committer name (coaxial) separately.

  • If code from the Llama Mini Firmware project is committed and used by Prusa, Prusa will be in violation of Llama Mini Firmware's GPLv3 license until Prusa releases source code for the bootloader (see [QUESTION] Where is the source code for the actual bootloader shipped with the Prusa Mini+? #1440). I already consider Prusa to be in violation of Marlin's license, but I am not a copyright holder of Marlin and therefore cannot take legal action. I am however a copyright holder of Llama Mini Firmware.

  • The logo image copied here from the Llama Mini Firmware (serial_printing.png, or the C transform thereof) is licensed under CC BY-NC-SA 4.0, which does not permit commercial use, either in the original form of the image (as I committed to Llama), or remixed, transformed, or built upon, as in this pull request. I do not give permission for Prusa to use this image for commercial purposes. Please make your own.

@coaxial
Copy link
Author

coaxial commented Jul 14, 2021

Thank you both for the feedback.

I have made the following changes:

  • Set the author to Matthew Lloyd <[email protected]> in the commit including all files in this PR
  • Made my own small Octoprint logo by shrinking the original Octoprint logo using GIMP (no author attribution to Matthew Lloyd on that commit)
  • Added the missing header file

@matthewlloyd: I hope it is clear my intent was not to usurp your work, which is why I mentioned in the PR's comments where the code comes from (your Llama firmware repo). I just didn't think to set the author on the commits to you. I apologize for that, and I believe I have now resolved that issue properly.

edit: and it still doesn't build. I can't see why since I haven't got access to holly.prusa3d.com

@wavexx
Copy link
Contributor

wavexx commented Sep 12, 2021

@coaxial you can run the test build yourself to see what is failing, which is much quicker. The file utils/holly/build-pr.jenkins contains the actual recipe being used for testing. It simply runs ctest appropriately. If you have a linux env, you can do:

ctest --build-and-test . build-test --build-generator Ninja \
      --build-target tests --test-command ctest

from the source directory to create the "build-test" directory and run the tests inside that in one shot.
Keep the directory and run "ninja tests" to re-run them if needed while working.

@coaxial coaxial changed the base branch from RELEASE-4.3.2 to RELEASE-4.3.4 February 23, 2022 07:59
@coaxial
Copy link
Author

coaxial commented Feb 23, 2022

When running ctest --build-and-test . build-test --build-generator Ninja --build-target tests --test-command ctest, I am getting 100% tests passed, 0 tests failed out of 60. As before, can't see why it's failing here because I won't give holly.prusa3d.com access to ALL my repos (including private ones).

Note I have rebased this on RELEASE-4.3.4 but can't change the PR's branch name.

@coaxial
Copy link
Author

coaxial commented Mar 1, 2022

@DRracer please advise

@MistrKernnunos
Copy link
Contributor

It looks like there is some problem with compiling your code. This is the error.

'static bool GcodeSuite::process_parsed_command_custom(bool)':
../../src/marlin_stubs/gcode.cpp:19:17: error: 'queue' was not declared in this scope
                 queue.ok_to_send();
                 ^~~~~

@coaxial
Copy link
Author

coaxial commented Mar 3, 2022

Thank you, I've added the missing include for that entity.

The build is still failing. I tried building it locally with make all, but I'm getting errors[0] on files I haven't touched.

I really wish I could see the Holly build system's output without granting it access to all my public and private repos.

[0]:

/home/user/code/Prusa-Firmware-Buddy/lib/Drivers/CMSIS/Include/cmsis_gcc.h: Assembler messages:
/home/user/code/Prusa-Firmware-Buddy/lib/Drivers/CMSIS/Include/cmsis_gcc.h:879: Error: number of operands mismatch for `ds'
/home/user/code/Prusa-Firmware-Buddy/lib/Drivers/CMSIS/Include/cmsis_gcc.h:868: Error: no such instruction: `isb 0xF'
/home/user/code/Prusa-Firmware-Buddy/lib/Drivers/CMSIS/Include/cmsis_gcc.h:879: Error: number of operands mismatch for `ds'
/home/user/code/Prusa-Firmware-Buddy/lib/Drivers/CMSIS/Include/cmsis_gcc.h:879: Error: number of operands mismatch for `ds'
/home/user/code/Prusa-Firmware-Buddy/lib/Drivers/CMSIS/Include/cmsis_gcc.h:890: Error: no such instruction: `dmb 0xF'
/home/user/code/Prusa-Firmware-Buddy/lib/Drivers/CMSIS/Include/cmsis_gcc.h:879: Error: number of operands mismatch for `ds'
/home/user/code/Prusa-Firmware-Buddy/lib/Drivers/CMSIS/Include/cmsis_gcc.h:868: Error: no such instruction: `isb 0xF'
make[2]: *** [lib/Drivers/STM32F4xx_HAL_Driver/CMakeFiles/HAL.dir/build.make:102: lib/Drivers/STM32F4xx_HAL_Driver/CMakeFiles/HAL.dir/Src/stm32f4xx_hal_cortex.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1124: lib/Drivers/STM32F4xx_HAL_Driver/CMakeFiles/HAL.dir/all] Error 2
make: *** [Makefile:95: all] Error 2

@MistrKernnunos
Copy link
Contributor

MistrKernnunos commented Mar 7, 2022

It seem like you have some problems with build. Try to build the firmware with the bundled build.py script.
You can find more info here
And we are using Ninja as generator for cmake

@coaxial
Copy link
Author

coaxial commented Mar 7, 2022

@MistrKernnunos Thanks. I tried building it locally but it simply fails without any explanation or context:

$ python3 utils/build.py --printer mini
Building mini_release_boot: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:22<00:00,  7.45s/it]

Building finished: 0 success, 3 failure(s).
 mini_release_noboot    build FAILED
 mini_release_emptyboot build FAILED
 mini_release_boot      build FAILED

@MistrKernnunos
Copy link
Contributor

Try to rebase the branch on current master and you should get newer version of build system which is based on CMake presets. And the use something like this

python3 utils/build.py --preset mini

or

cmake -S . --preset=mini_release_boot'
cd build-vscode
ninja

@coaxial
Copy link
Author

coaxial commented Jul 23, 2022

I am burnt out working on this issue, I just don't have the time or bandwidth to deal with it. I also don't know C enough to solve the current build issues.

I still think it's a glaring omission in the firmware for a printer that is marketed "for print farms", yet doesn't support the standard set of GCode for printing over serial 3 years after release...

If anyone wants to look into it here is what's left to do:

  • Rebase on current master
  • Investigate the build error (see below)
$ python3 utils/build.py --preset mini

FAILED: CMakeFiles/firmware.dir/src/gui/screen_printing_serial.cpp.obj
/home/pierre/code/Prusa-Firmware-Buddy/.dependencies/gcc-arm-none-eabi-10.3.1/bin/arm-none-eabi-g++ -DARDUINO=187 -DBOARD=BOARD_BUDDY -DBOARD_VERSION_MAJOR=1 -DBOARD_VERSION_MINOR=0 -DBOARD_VERSION_PATCH=0 -DBOOTLOADER -DBUDDY_ENABLE_WUI -DCFG_TUSB_MCU=OPT_MCU_STM32F4 -DGUI=YES -DHAS_MARLIN=1 -DHAS_MMU2=0 -DHAVE_HWSERIAL2 -DMARLIN_DISABLE_INFINITE_LOOP -DMBEDTLS_CONFIG_FILE=\"/home/pierre/code/Prusa-Firmware-Buddy/include/mbedtls/cipher_config_ece.h\" -DMCU=STM32F407VG -DMOTHERBOARD=1823 -DPRINTER_TYPE=PRINTER_PRUSA_MINI -DPROCESS_CUSTOM_GCODE -DSTM32F4 -DSTM32F407xx -DSTM32F4xx -DSTM32GENERIC -DUSBCON -DUSBD_USE_CDC -DUSE_HAL_DRIVER -D_EXTUI -I/home/pierre/code/Prusa-Firmware-Buddy/src/. -I/home/pierre/code/Prusa-Firmware-Buddy/src/common/. -I/home/pierre/code/Prusa-Firmware-Buddy/src/common/include -I/home/pierre/code/Prusa-Firmware-Buddy/src/common/selftest/MINI -I/home/pierre/code/Prusa-Firmware-Buddy/build/mini_release_boot/src/resources/include -I/home/pierre/code/Prusa-Firmware-Buddy/src/gui/wizard/. -I/home/pierre/code/Prusa-Firmware-Buddy/src/guiapi/include -I/home/pierre/code/Prusa-Firmware-Buddy/src/gui -I/home/pierre/code/Prusa-Firmware-Buddy/src/gui/dialogs -I/home/pierre/code/Prusa-Firmware-Buddy/src/gui/footer -I/home/pierre/code/Prusa-Firmware-Buddy/src/gui/wizard -I/home/pierre/code/Prusa-Firmware-Buddy/src/guiconfig -I/home/pierre/code/Prusa-Firmware-Buddy/src/lang -I/home/pierre/code/Prusa-Firmware-Buddy/src/hw -I/home/pierre/code/Prusa-Firmware-Buddy/src/segger -I/home/pierre/code/Prusa-Firmware-Buddy/src/logging -I/home/pierre/code/Prusa-Firmware-Buddy/src/syslog -I/home/pierre/code/Prusa-Firmware-Buddy/include/mbedtls -I/home/pierre/code/Prusa-Firmware-Buddy/include/stm32f4_hal -I/home/pierre/code/Prusa-Firmware-Buddy/include/device/stm32f4 -I/home/pierre/code/Prusa-Firmware-Buddy/include -I/home/pierre/code/Prusa-Firmware-Buddy/include/usb_host -I/home/pierre/code/Prusa-Firmware-Buddy/include/usb_device -I/home/pierre/code/Prusa-Firmware-Buddy/include/marlin -I/home/pierre/code/Prusa-Firmware-Buddy/include/freertos -I/home/pierre/code/Prusa-Firmware-Buddy/build/mini_release_boot/include -I/home/pierre/code/Prusa-Firmware-Buddy/include/buddy -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Drivers/STM32F4xx_HAL_Driver/Inc -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Drivers/CMSIS/Include -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Drivers/CMSIS/Device/ST/STM32F4xx/Include -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/FreeRTOS/Source/include -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Segger -I/home/pierre/code/Prusa-Firmware-Buddy/include/segger -I/home/pierre/code/Prusa-Firmware-Buddy/lib/printf -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Marlin/Marlin/src -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Marlin/Marlin/src/gcode/lcd -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Marlin/Marlin -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Marlin -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Arduino_Core_Buddy/variants/BUDDY_F407VET6_2209 -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Arduino_Core_Buddy/cores/arduino/stm32 -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Arduino_Core_Buddy/cores/arduino -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc -I/home/pierre/code/Prusa-Firmware-Buddy/lib/tinyusb/src -I/home/pierre/code/Prusa-Firmware-Buddy/include/tinyusb -I/home/pierre/code/Prusa-Firmware-Buddy/lib/TMCStepper/src -I/home/pierre/code/Prusa-Firmware-Buddy/src/common -I/home/pierre/code/Prusa-Firmware-Buddy/src/marlin_stubs/include -I/home/pierre/code/Prusa-Firmware-Buddy/src/common/selftest -I/home/pierre/code/Prusa-Firmware-Buddy/lib/LiquidCrystal_I2C/. -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/LwIP/system -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/LwIP/src/include -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/LwIP/src/include/netif/ppp -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/LwIP/src/include/lwip -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/LwIP/src/include/lwip/priv -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/LwIP/src/include/lwip/prot -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/LwIP/src/include/netif -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/LwIP/src/include/posix -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/FatFs/src -I/home/pierre/code/Prusa-Firmware-Buddy/lib/ESP/serial-flasher/include -I/home/pierre/code/Prusa-Firmware-Buddy/lib/ESP/serial-flasher/port -I/home/pierre/code/Prusa-Firmware-Buddy/lib/ESP/serial-flasher/private_include -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/littlefs/. -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/lpng/. -I/home/pierre/code/Prusa-Firmware-Buddy/lib/inih -I/home/pierre/code/Prusa-Firmware-Buddy/lib/WUI -I/home/pierre/code/Prusa-Firmware-Buddy/lib/WUI/http -I/home/pierre/code/Prusa-Firmware-Buddy/lib/WUI/sntp -I/home/pierre/code/Prusa-Firmware-Buddy/lib/WUI/resources -I/home/pierre/code/Prusa-Firmware-Buddy/build/mini_release_boot -I/home/pierre/code/Prusa-Firmware-Buddy/build/mini_release_boot/lib/WUI -I/home/pierre/code/Prusa-Firmware-Buddy/lib/jsmn -I/home/pierre/code/Prusa-Firmware-Buddy/lib/QR/. -I/home/pierre/code/Prusa-Firmware-Buddy/build/mini_release_boot/src/lang -I/home/pierre/code/Prusa-Firmware-Buddy/lib/libsysbase/. -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/mbedtls/include -I/home/pierre/code/Prusa-Firmware-Buddy/lib/Middlewares/Third_Party/mbedtls/include/mbedtls --specs=nosys.specs --specs=nano.specs -O3 -DNDEBUG -Wall -Wsign-compare -Wno-register -std=c++1z -DconfigUSE_NEWLIB_REENTRANT=1 -g -Os -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-exceptions -fno-unwind-tables -Wdouble-promotion -std=gnu++17 -MD -MT CMakeFiles/firmware.dir/src/gui/screen_printing_serial.cpp.obj -MF CMakeFiles/firmware.dir/src/gui/screen_printing_serial.cpp.obj.d -o CMakeFiles/firmware.dir/src/gui/screen_printing_serial.cpp.obj -c /home/pierre/code/Prusa-Firmware-Buddy/src/gui/screen_printing_serial.cpp
/home/pierre/code/Prusa-Firmware-Buddy/src/gui/screen_printing_serial.cpp: In function 'point_ui16_t pt_ico()':
/home/pierre/code/Prusa-Firmware-Buddy/src/gui/screen_printing_serial.cpp:12:62: error: 'IDR_PNG_serial_printing' was not declared in this scope
   12 | static point_ui16_t pt_ico() { return icon_meas(resource_ptr(IDR_PNG_serial_printing)); }
      |                                                              ^~~~~~~~~~~~~~~~~~~~~~~
/home/pierre/code/Prusa-Firmware-Buddy/src/gui/screen_printing_serial.cpp: In constructor 'screen_printing_serial_data_t::screen_printing_serial_data_t()':
/home/pierre/code/Prusa-Firmware-Buddy/src/gui/screen_printing_serial.cpp:16:116: error: 'IDR_PNG_serial_printing' was not declared in this scope
   16 |     , octo_icon(this, Rect16(120 - pt_ico().x / 2, GuiDefaults::RectScreenBody.Top() + 8, pt_ico().x, pt_ico().y), IDR_PNG_serial_printing)
      |                                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~

Using https://github.com/matthewlloyd/Llama-Mini-Firmware for reference, although I think the two repos have diverged quite a bit.

@coaxial coaxial changed the base branch from RELEASE-4.3.4 to master July 23, 2022 09:37
@Eldenroot
Copy link

Is it planned or not? Because many users want this and maybe Prussa tema could take look :)

@Bpendragon
Copy link

I really wish I could see the Holly build system's output without granting it access to all my public and private repos.

@coaxial I know this is a year on, but I ran into a similar thing in the past, I just created a second "Fully Public" account that it was fine for systems like Holly to hit. It's a bit of a crude workaround, but it does work.

@coaxial
Copy link
Author

coaxial commented Jun 22, 2023

Thanks for the tip. I don't have the bandwidth to work on this anymore, and it would most likely need to be rebased on the current master before any further work can be done.

If anyone feels like taking this on, it would be nice. Maybe even @josefprusa themselves could finally add this sorely missing feature to the Mini.

@Monkopedia
Copy link

@coaxial I was able to rebase this and get it building (excluding some probably flaky pre-commit issue), could you help me test it? I'm waiting on my mk4 because of lead-times.

#3147
https://holly.prusa3d.com/blue/organizations/jenkins/Prusa-Firmware-Buddy%2FMultibranch/detail/PR-3147/1/artifacts

@coaxial
Copy link
Author

coaxial commented Jul 20, 2023

@Monkopedia Nice! I don't have access to holly.prusa3d.com because it demands access to all public and private repos to access it... Which I won't allow. Also, I own a Mini which requires physical, irreversible damage to flash custom firmware onto. As such, I'm limited to official firmware only :/

@teotwaki
Copy link

@coaxial What should be done to get this PR moving again? Is it still relevant? Should it be closed instead?

@danopernis
Copy link
Member

This is not going to be merged, for several reasons

  • it is based on @matthewlloyd work and I personally do not want to spend any time arguing licensing with them
  • serial printing screen should be replaced anyway, as it doesn't show a lot of other potentially useful information
  • original author @coaxial doesn't want to spent anymore time on this and frankly, I am not surprised. I am truly sorry for all the effort you put into it without any result 😞

Closing this.

@danopernis danopernis closed this Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"feature request" show information's of prints from OctoPrint
10 participants